/**
 * Created by Administrator on 2016/5/3.
 */
(function () {
    angular.module('link', [])
        .directive('myDiv', function ($sce) {
            return {
                templateUrl: 'link-div.html',
                restrict: 'E',
                controller: function ($scope) {
                    $scope.code = '<h1>abc</h1>';
                },
                link: function (scope, element) {
                    scope.code = $sce.trustAsHtml(scope.code);
                    element.on('click', function () {
                        element.find('p').toggleClass('hidden');
                    })
                },
                scope: {
                    code: '='
                }
            };
        })
})();
